<template>
  <el-radio-group v-model="value" :placeholder="item.placeholder">
    <el-radio v-for="option in item.options.filter((i: any) => i.show)" :key="option.value" :label="option.value"
      :style="`width:${item.optionWidth}px`" v-bind="item.props" v-on="item.props">
      {{ option.label }}
    </el-radio>
  </el-radio-group>
</template>

<script lang="ts" setup>
import { computed } from "vue";
import { IFormItem } from '../type'
interface IProps {
  item: IFormItem;
  modelValue: any;
}
interface IEmit {
  (event: 'update:modelValue', data: any): void
}
const props = defineProps<IProps>()
const emit = defineEmits<IEmit>()
const value = computed({
  get() {
    return props.modelValue
  }, set(value) {
    emit('update:modelValue', value)
  }
})
</script>

<style scoped lang="scss"></style>